/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pnt.message.objects;

import java.net.InetSocketAddress;
import pnt.message.Utils;
/**
 *
 * @author andrew
 */
public class ExtEndpoint {
    private InetSocketAddress nativeEndpoint;
    private InetSocketAddress natExtEndpoint;
    private InetSocketAddress snPntEndpoint;
    private InetSocketAddress snRelayEndpoint;
    
    private NatType nattype;
    
    public ExtEndpoint(NatType nattype){
        this.nattype = nattype;
    }

    public

    NatType getNattype() {
        return nattype;
    }

    public void setNattype(NatType nattype) {
        this.nattype = nattype;
    }

    public InetSocketAddress getNativeEndpoint() {
        return nativeEndpoint;
    }

    public void setNativeEndpoint(InetSocketAddress nativeEndpoint) {
        this.nativeEndpoint = nativeEndpoint;
    }

    public InetSocketAddress getNatExtEndpoint() {
        return natExtEndpoint;
    }

    public void setNatExtEndpoint(InetSocketAddress natExtEndpoint) {
        this.natExtEndpoint = natExtEndpoint;
    }

    public InetSocketAddress getSnPntEndpoint() {
        return snPntEndpoint;
    }

    public void setSnPntEndpoint(InetSocketAddress snPntEndpoint) {
        this.snPntEndpoint = snPntEndpoint;
    }

    public InetSocketAddress getSnRelayEndpoint() {
        return snRelayEndpoint;
    }

    public void setSnRelayEndpoint(InetSocketAddress snRelayEndpoint) {
        this.snRelayEndpoint = snRelayEndpoint;
    }
    
    public String toString(){
    	switch(nattype){
    	case NO_NAT:
    		return "NoNAT:{ " + Utils.formatSocketAddress(this.nativeEndpoint) + " }";
    	case CONE_NAT:
    		return "ConeNAT:{ " + Utils.formatSocketAddress(this.natExtEndpoint) + " , " + Utils.formatSocketAddress(this.snPntEndpoint) + " }";
    	case SYMM_NAT:
    		return "ConeNAT:{ " + Utils.formatSocketAddress(this.snRelayEndpoint) + "," + Utils.formatSocketAddress(this.snPntEndpoint) + " }";
    	}
    	return "";
    }    
    
    public enum NatType{
        NO_NAT, CONE_NAT, SYMM_NAT;
    }
    

}
